package com.cong.project.config;

import io.minio.MinioClient;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author lhc
 * @date 2022-08-16 11:30
 */
@Configuration
public class MinioConfig {
    @Autowired
    private MinioProerties minioProerties;
    @Bean
    public MinioClient minioClient(){
        MinioClient minioClient = MinioClient.builder()
                .endpoint(minioProerties.getEndpoint())
                .credentials(minioProerties.getAccessKey(),minioProerties.getSecretKey())
                .build();
        return minioClient;
    }
}
